//
//  ChildHoodMessage.h
//  ChildHoodStemp
//
//  Created by xuzuotao on 13-9-18.
//
//

#import <Foundation/Foundation.h>
#import "Snsp.pb.h"
#import "ContactsGroup.h"
#import "CHBubbleView.h"
@class ChildHoodMemory;
@interface ChildHoodMessage : NSObject
{
    ChildHoodMemory* _childHoodMemory;  //发送者的Memory
    SNSPMessage*     _snspMessage;      //消息对象
    int32_t          _totalCount;
    
    int64_t          _messageDBID;
    MessageSendType  _messageStatus;
    NSString*        _messageFilePath;
    int32_t          _materialCount;
    
    MessageSoundPlayStatus             _isPlayed;
    BOOL             _isDownloaded;
    CHBubbleMessageType _isMine;
}


@property (nonatomic, assign) CHBubbleMessageType isMine;
@property(nonatomic, readonly, assign, getter = getMessageSerDBID) int64_t messageSerDBID;                  //消息在服务器的数据库ID
@property(nonatomic, readonly, assign, getter = getMessageGMTTime) int64_t messageGMTTime;
@property(nonatomic, readonly, retain, getter = getMessageContent)NSString* messageContent;                 //消息内容
@property(nonatomic, readonly, retain, getter = getMessageTime)NSDate* messageTime;                       //消息发送时间
@property(nonatomic, readonly, assign, getter = getMemoryValid)BOOL      memoryValid;                       //发送者的Memory对象是否有效
@property(nonatomic, readonly, retain, getter = getSenderName)NSString* senderName;                        //发送者姓名
@property(nonatomic, readonly, retain, getter = getSenderPortraitImageUri)NSString*  senderPortraitImageUri;      //发送者小头像

@property(nonatomic, readonly, retain, getter = getSenderPortraitImageNextUri)NSString*  senderPortraitImageNextUri;      //发送者大头像


@property(nonatomic, readwrite, retain, getter = getFileUri)NSString*  fileUri;      //if the message is a multimedia message the fileuri is used

@property(nonatomic, readonly, retain, getter = getFileNextUri)NSString*  nextFileUri;      //if the message is a multimedia message the fileuri is used

//@property(nonatomic, readonly, retain, getter = getMessageDtata)NSData*  messageData;                        //消息数据（图片、音频等）
@property(nonatomic, readonly, assign, getter = getMessageType)SNSPMaterialType  messageType;                //消息数据类型（文字，音频，图片）
@property(nonatomic, readonly, assign, getter = getType)SNSPMessageType type;                                //消息类型
@property(nonatomic, readonly, assign, getter = getMemoryID)uint32_t      memoryID;                          //发送者的MemoryID
@property(nonatomic, readonly, assign, getter = getMessageRoomID)int64_t      messageRoomID;

@property(nonatomic, readonly, assign, getter = getRelativeType)int32_t      relativeType;

@property(nonatomic, readonly, retain, getter = getTitle)NSString* title;

@property(nonatomic, readwrite, assign)int32_t   totalCount;

@property(nonatomic, readwrite, retain)NSString* messageFilePath;

@property(nonatomic, readonly, retain)SNSPMessage* snspMessage;

@property(nonatomic, readwrite, assign)int64_t   messageDBID;
//公司id
@property(nonatomic,copy)NSString *companyCode;
@property(nonatomic, readwrite, assign) MessageSendType messageStatus;
@property (nonatomic, strong) NSString *showMessageStr;
@property(nonatomic, assign)NSInteger progressReport;
@property(nonatomic, readwrite, assign)int32_t   materialCount;
@property(nonatomic, assign)BOOL isRead;
@property(nonatomic, assign)BOOL isShowing;
@property(nonatomic, assign)MessageSoundPlayStatus isPlayed;
@property(nonatomic, assign)BOOL isDownloaded;
@property (nonatomic, copy) NSString *MineUserId;
@property (nonatomic, copy) NSString *FriendUserId;
@property (nonatomic, copy) NSString *GroupId;
@property (nonatomic, assign) NSInteger SoundLenth;
@property (nonatomic, copy) NSString *fileName;
@property (nonatomic, copy) NSString *fileLenth;
@property (nonatomic, copy) NSString *fromName;
@property (nonatomic, assign) BOOL isKefu;
@property (nonatomic, assign) BOOL isWaibu;
CopyProperty NSString *messageId;

-(id)initWithSNSMessage:(SNSPMessage*) snspMessage;
-(void)setChildHoodMemory:(ChildHoodMemory*)childhoodMemory;
-(void)setSNSPMessageData:(NSData*)messageData;


-(BOOL)isMemroyInValid;

@property(nonatomic, readonly, assign, getter = getSenderGroupType)ContactsGroupType  senderGroupType;

@property(nonatomic, readonly, retain, getter = getSenderGroupName)NSString *  senderGroupName;

@end



